package cz.techi;

import java.util.Calendar;
import java.util.Date;

import junit.framework.TestCase;

public class SubjectTest extends TestCase {

	private Subject subject;
	
	protected void setUp() throws Exception {
		super.setUp();
		
		subject = new Subject();
	
		subject.ident = "Ident";
		subject.name = "Name";
		subject.type = "LECTURE";
		subject.from = "09:15";
		subject.to = "11:00";
		subject.day = "fri";
		subject.hour = 1;
		
	}

	public void testGetIdent() {
		assertEquals("Ident", subject.getIdent());
	}

	public void testGetName() {
		assertEquals("Name", subject.getName());
	}

	public void testGetType() {
		assertEquals(Subject.TYPE_LECTURE, subject.getType());
	}

	public void testGetDay() {
		assertEquals(Calendar.FRIDAY, subject.getDay());
	}

	public void testGetStart() {
		Date date = new Date();
		date.setHours(9);
		date.setMinutes(15);
		date.setSeconds(0);
		
		assertEquals(date, subject.getStart());
		
	}

	public void testGetEnd() {
		Date date = new Date();
		date.setHours(11);
		date.setMinutes(0);
		date.setSeconds(0);
		
		assertEquals(date, subject.getEnd());

	}

	public void testGetLocalizedDay() {
		assertEquals("Friday", subject.getLocalizedDay());
	}

}
